package com.hl.secondHand.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hl.secondHand.common.vo.EasyGoods;
import com.hl.secondHand.entity.Goods;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author hl
 * @since 2021-06-06
 */
@Component
public interface GoodsMapper extends BaseMapper<Goods> {
    @Select("select g.id,g.name,g.image,format(g.amount,2) as amount,g.introduce,u.name as uname from goods g ,user u where g.state = 1 and g.uid = u.id order By g.last_modified_date desc")
    List<EasyGoods> getEasyGoods();
}
